package com.study.concurrent;

import java.util.concurrent.locks.ReentrantLock;

public class Counter {
	private int count;
	private ReentrantLock lock = new ReentrantLock();

	public Counter(int count) {
		this.count = count;
	}

	public  void increase(){
		count++;
	}

	public synchronized void increaseBySyn(){
		count++;
	}

	public void increaseByLock(){
		lock.lock();
		count++;
		lock.unlock();
	}

	public int getCount() {
		return count;
	}
}
